<template>
	<view>
		<!-- #ifdef H5 -->
		<u-sticky offset-top="-45" bgColor="#fff" class="top">
			<u-tabs @click="onclick" :list="list1">
				<view slot="right" class="tianjia">
					<u-icon name="man-add" size="50" bold @click="ontianjia"></u-icon>
					<u-icon name="search" size="50" bold @click="onsousuo"></u-icon>
				</view>
			</u-tabs>
		</u-sticky>
		<!-- #endif -->
		<!-- #ifdef MP-WEIXIN -->
		<u-sticky offset-top="-1px" bgColor="#fff">
			<u-tabs @click="onclick" :list="list1">
				<view slot="right" class="tianjia">
					<u-icon name="man-add" size="50" bold @click="ontianjia"></u-icon>
					<u-icon name="search" size="50" bold @click="onsousuo"></u-icon>
				</view>
			</u-tabs>
		</u-sticky>
		<!-- #endif -->
		<view v-if="current==0">
			<circles>
			</circles>
		</view>
		<view v-else>
			<commity></commity>
		</view>
		<custom-tabbar :current="1"></custom-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				list1: [{
					name: '关注',
				}, {
					name: '推荐',
				}],
				loaded: false
			};
		},
		onShow() {
			this.loaded = uni.getStorageSync('loaded')
			if (this.loaded == false) {
				uni.switchTab({
					url: '/pages/user/user'
				})
			}
		},
		methods: {
			onclick(e) {
				this.current = e.index
			},
			ontianjia() {
				console.log(111);
				uni.navigateTo({
					url: '/pages/selected/tainjia/tainjia'
				})
			},
			onsousuo() {
				console.log(123);
				uni.navigateTo({
					url: "/pages/selected/sousuo/sousuo"
				})
			}
		}
	}
</script>

<style lang="scss">
	* {
		padding: 0;
		margin: 0;
	}

	.tianjia {
		display: flex;
		justify-content: space-around;
		width: 100px;
	}
</style>
